package config

import (
	"encoding/json"
	"fmt"
	"os"
)

type JsonConfig struct {
	Port      int
	PushPaths []string
	LivePaths []string
}

var Config JsonConfig

func LoadConfig(path string) {
	open, err := os.Open(path)
	if err != nil {
		fmt.Printf("config read error usage default config: %v\n", err)
		return
	}
	decoder := json.NewDecoder(open)
	err = decoder.Decode(&Config)
	if err != nil {
		fmt.Printf("config decode usage default config: %v\n", err)
		return
	}
	return
}
